package com.hbk.controller;

import com.hbk.base.util.PageUtil;
import com.hbk.service.IWebService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
public class ErrorPageController {

    @Resource
    private IWebService webService;

    @RequestMapping(value = {"/400", "/401", "/402", "/403"})
    public String error4xx(){
        return "/error";
    }

    @RequestMapping(value = "/404")
    public String error404(HttpServletRequest request){
        webService.getNav(request);
        return PageUtil.fromClient() + "/404";
    }
}
